//
//  TabBarView.m
//  MooMusic
//
//  Created by wjy on 15/10/27.
//  Copyright © 2015年 wjy. All rights reserved.
//

#import "TabBarView.h"

@implementation TabBarView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self songCreateView];
    }
    return self;
}

- (void)songCreateView
{
    // 创建播放单例视图
    self.songImage = [[UIButton alloc]init];
    [self addSubview:self.songImage];
    
    self.songName = [[UILabel alloc]init];
    [self addSubview:self.songName];
    
    self.songerName = [[UILabel alloc]init];
    [self addSubview:self.songerName];
    
    self.songStopORStart = [[UIButton alloc]init];
    [self addSubview:self.songStopORStart];
    
    self.songsList = [[UIButton alloc]init];
    [self addSubview:self.songsList];
    
    // 设置属性
    self.songImage.frame = CGRectMake(10, 6.5, 36, 36);
    self.songImage.clipsToBounds = YES;
    [self.songImage setImage:[UIImage imageNamed:@"back1.jpg"] forState:(UIControlStateNormal)];
    self.songImage.layer.cornerRadius = 18;
    // 17 15   7-17-3-15-7
    self.songName.frame = CGRectMake(60, 8, 200, 17);
    [self.songName setTextColor:[UIColor whiteColor]];
    self.songName.font = [UIFont systemFontOfSize:15];
    self.songName.numberOfLines = 1;
    
    self.songerName.frame = CGRectMake(60, 28, 200, 15);
    self.songerName.font = [UIFont systemFontOfSize:13];
    self.songerName.numberOfLines = 1;
    [self.songerName setTextColor:[UIColor whiteColor]];
    self.songerName.alpha = 0.5;
    
    self.songName.text = @"songName";
    self.songerName.text = @"singerName";
    
    // 30-26-30-16
    self.songStopORStart.frame = CGRectMake(self.bounds.size.width - 102, 9.5, 30, 30);
    [self.songStopORStart setImage:[UIImage imageNamed:@"playMusic"] forState:(UIControlStateNormal)];
    [self.songStopORStart setImage:[UIImage imageNamed:@"pause"] forState:(UIControlStateSelected)];
//        [self.songStopORStart addTarget:self action:@selector(startORstop:) forControlEvents:(UIControlEventTouchUpInside)];
    
    
    self.songsList.frame = CGRectMake(self.bounds.size.width - 46, 9.5, 30, 30);
    [self.songsList setImage:[UIImage imageNamed:@"musicliebiao"] forState:(UIControlStateNormal)];
    
    
    [self.songImage addTarget:self action:@selector(rotate:) forControlEvents:(UIControlEventTouchUpInside)];
    
    
}

- (void)rotate:(UIButton *)sender
{
    
}



- (void)playMusic
{
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
